<?php 
include("conexion.php");
require_once("includes/combo.php")  	  ;
$oCombo = new CmbList()  				  ;

//$codmpago=$_POST['codmpago'];
$detbien=$_POST['detbien'];

$sqltbienn   = mysql_query("SELECT * FROM tipobien",$conn) or die(mysql_error());

$sqltpago=mysql_query("SELECT * FROM detallebienes",$conn) or die(mysql_error()); 

$sqlbancos=mysql_query("SELECT * FROM bancos",$conn) or die(mysql_error()); 


$consulbienes=mysql_query("SELECT * FROM detallebienes where detallebienes.detbien='$detbien'", $conn) or die(mysql_error());

$rowmbien = mysql_fetch_array($consulbienes);

// ubigeo:
$consulbienubi=mysql_query("SELECT CONCAT(ubigeo.nomdpto,'/',ubigeo.nomprov,'/',ubigeo.nomdis) 
FROM ubigeo
INNER JOIN detallebienes ON detallebienes.coddis = ubigeo.coddis
WHERE detallebienes.coddis = '".$rowmbien['coddis']."'", $conn) or die(mysql_error());
$rowubigeo = mysql_fetch_array($consulbienubi);


?>
<style type="text/css">
.titupatrimo {font-size: 12; font-style: italic; font-family: Calibri;}
</style>
    
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0">
                                                      <tr>
                                                        <td height="19">&nbsp;</td>
                                                        <td height="19">&nbsp;</td>
                                                        <td height="19">&nbsp;</td>
                                                        <td height="19" align="right"><a href="#" onClick="ocultar_desc('verbienesedit');fDest_DivBienesedita();"><img src="iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
                                                      </tr>
                                                      <tr>
                                                        <td width="135" height="30"><span class="titupatrimo">Tipo</span></td>
                                                        <td width="208" height="30"><span class="titupatrimo">
                                                          <label></label>
                                                          <label>
                                                            <?php 
			$oCombo = new CmbList()  ;					 		
			$oCombo->dataSource = "SELECT tipbien.des_tipbien AS 'id', tipbien.des_tipbien AS 'des' FROM tipbien"; 
			$oCombo->value      = "id";
			$oCombo->text       = "des";
			$oCombo->size       = "150"; 
			$oCombo->name       = "tipob2";
			$oCombo->style      = ""; 
			$oCombo->click      = "//selectAsunto(this.value);";   
			$oCombo->selected   =  $rowmbien['tipob'];
			$oCombo->Show();
			$oCombo->oDesCon(); 
?>
                                                          </label>
                                                        </span></td>
                                                        <td width="118" height="30"><span class="titupatrimo">Partida Registral</span></td>
                                                        <td width="219" height="30"><span class="titupatrimo">
                                                          <label></label>
                                                        <input name="pregis5" style="background:#FFFFFF" type="text" id="pregis5" size="20"  value="<?php echo $rowmbien['pregistral']; ?>" />
                                                        </span></td>
                                                      </tr>
                                                      <tr>
                                                        <td height="30"><span class="titupatrimo">Bien-Acto Jurídico</span></td>
                                                        <td height="30"><span class="titupatrimo">
                                                          <label></label>
                                                          <?php 
			$oCombo = new CmbList()  ;					 		
			$oCombo->dataSource = "SELECT tipobien.idtipbien AS 'id', tipobien.desestcivil AS 'des' 
FROM tipobien ORDER BY tipobien.desestcivil ASC"; 
			$oCombo->value      = "id";
			$oCombo->text       = "des";
			$oCombo->size       = "150"; 
			$oCombo->name       = "tipobien2";
			$oCombo->style      = ""; 
			$oCombo->click      = "//selectAsunto(this.value);";   
			$oCombo->selected   = $rowmbien['idtipbien'];
			$oCombo->Show();
			$oCombo->oDesCon(); 
?>
                                                        </span></td>
                                                        <td height="30"><span class="titupatrimo">Sede Registral</span></td>
                                                        <td height="30"><span class="titupatrimo">
                                                          <?php 
			$oCombo = new CmbList()  ;					 		
			$oCombo->dataSource = "SELECT sedesregistrales.idsedereg AS 'id', sedesregistrales.dessede AS 'des'
FROM sedesregistrales"; 
			$oCombo->value      = "id";
			$oCombo->text       = "des";
			$oCombo->size       = "150"; 
			$oCombo->name       = "idsedereg5";
			$oCombo->style      = "camposss"; 
			$oCombo->click      = "//selectAsunto(this.value);";   
			$oCombo->selected   =  $rowmbien['idsedereg'];
			$oCombo->Show();
			$oCombo->oDesCon(); 
?>
                                                        </span></td>
                                                      </tr>
                                                      <tr>
                                                        <td height="30"><span class="titupatrimo">Ubigeo</span></td>
                                                        <td height="30" colspan="2"><input name="ubigens2" type="text" id="ubigens2"  size="45" value="<?php echo $rowubigeo[0];  ?>" /></td>
                                                        <td height="30"><a id="_busUbiEditBien" href="#" onClick="mostrar_desc('buscaubis2')"><img src="iconos/seleccionar.png" width="94" height="29" border="0" /></a>
                                                            <div id="buscaubis2" style="position:absolute; display:none; width:637px; height:223px; left: 14px; top: 125px; z-index:20; background:#CCCCCC; border: 1px solid #333333; border: 1px solid #264965; -moz-border-radius: 13px; -webkit-border-radius: 13px; border-radius: 13px; -moz-box-shadow: 0px 0px 5px #000000; -webkit-box-shadow: 0px 0px 5px #000000; box-shadow: 0px 0px 5px #000000;">
                                                              <table width="637" border="0" cellspacing="0" cellpadding="0">
                                                                <tr>
                                                                  <td width="24" height="29">&nbsp;</td>
                                                                  <td width="585" class="titupatrimo">Seleccionar Ubigeo:</td>
                                                                  <td width="28"><a id="_CloseUbiEditBien"  href="#" onClick="ocultar_desc('buscaubis2')"><img src="iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
                                                                </tr>
                                                                <tr>
                                                                  <td>&nbsp;</td>
                                                                  <td><label>
                                                                    <input name="buscaubis22" type="text" style="background:#FFFFFF" id="buscaubis22" size="60"  onkeyup="buscaubigeoss2()" />
                                                                  </label></td>
                                                                  <td>&nbsp;</td>
                                                                </tr>
                                                                <tr>
                                                                  <td>&nbsp;</td>
                                                                  <td><div id="resulubis2" style="width:585px; height:150px; overflow:auto"></div></td>
                                                                  <td>&nbsp;</td>
                                                                </tr>
                                                                <tr>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                </tr>
                                                              </table>
                                                            </div>
                                                          <input name="codubis2" type="hidden" id="codubis2" size="15" value="<?php echo $rowmbien['coddis']; ?>" /></td>
                                                      </tr>
                                                      <tr>
                                                        <td height="15"><span class="titupatrimo">Fecha de Add. o Cons.</span></td>
                                                        <td height="15"><span class="titupatrimo">
                                                          <label></label>
                                                          <label>
                                                          <input type="text" name="fechaconst2"  class="tcal" id="fechaconst2"  value="<?php echo $rowmbien['fechaconst'];  ?>"/>
                                                          </label>
                                                        </span></td>
                                                        <td height="30" align="center">&nbsp;</td>
                                                        <td height="30">&nbsp;</td>
                                                      </tr>
                                                      <tr>
                                                        <td height="15" align="right"><div id="vterrestres2" style="display:none; width:691px; height:83px; border:#003366 solid 1px; background:#CCCCCC; position:absolute; left: 21px; top: 250px;">
                                                            <table width="671" border="0" cellspacing="0" cellpadding="0">
                                                              <tr>
                                                                <td width="26" >&nbsp;</td>
                                                                <td width="118">&nbsp;</td>
                                                                <td width="138">&nbsp;</td>
                                                                <td width="135">&nbsp;</td>
                                                                <td width="254" align="right"><a href="#" onClick="ocultar_desc('vterrestres')"><img src="iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
                                                              </tr>
                                                              <tr>
                                                                <td><label></label></td>
                                                                <td class="titupatrimo"><input type="radio" name="radio3" id="radio3" value="P" onClick="selecpsm2(this.value)" <?php if($rowmbien['tpsm']='P') echo "checked"; ?> />
                                                                  N° de Placa </td>
                                                                <td class="titupatrimo"><input type="radio" name="radio3" id="radio4" value="S" onClick="selecpsm2(this.value)" <?php if($rowmbien['tpsm']='S') echo "checked"; ?> />
                                                                  N° de Serie</td>
                                                                <td class="titupatrimo"><input type="radio" name="radio3" id="radio5" value="M" onClick="selecpsm2(this.value)" <?php if($rowmbien['tpsm']='M') echo "checked"; ?> />
                                                                  N° de Motor</td>
                                                              <td><label>
                                                                  <input type="text" name="npsm2" style="background:#FFFFFF" id="npsm2" value="<?php echo $rowmbien['npsm'];  ?>" />
                                                                </label></td>
                                                              </tr>
                                                              <tr>
                                                                <td>&nbsp;</td>
                                                                <td>&nbsp;</td>
                                                                <td>&nbsp;</td>
                                                                <td>&nbsp;</td>
                                                                <td><label>
                                                                  <input type="hidden" name="tpsm2" id="tpsm2" />
                                                                </label></td>
                                                              </tr>
                                                            </table>
                                                        </div>
                                                            <div id="mequipos" style="display:none; width:674px; height:71px; border:#003366 solid 1px; background:#CCCCCC; position:absolute; left: 25px; top: 250px;">
                                                              <table width="661" border="0" cellspacing="0" cellpadding="0">
                                                                <tr>
                                                                  <td width="32">&nbsp;</td>
                                                                  <td width="101">&nbsp;</td>
                                                                  <td width="128">&nbsp;</td>
                                                                  <td width="55">&nbsp;</td>
                                                                  <td width="345" align="right"><a href="#" onClick="ocultar_desc('mequipos')"><img src="iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
                                                                </tr>
                                                                <tr>
                                                                  <td><label></label></td>
                                                                  <td colspan="3" align="center" class="titupatrimo"> N° de Serie para Maquinaris y Equipos</td>
                                                                  <td><label>
                                                                    <input type="text" name="smaquiequipo2" style="background:#FFFFFF" id="smaquiequipo2" value="<?php echo $rowmbien['smaquiequipo'];  ?>" />
                                                                  </label></td>
                                                                </tr>
                                                                <tr>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                </tr>
                                                              </table>
                                                            </div>
                                                          <div id="oespecificos" style="display:none; width:652px; height:71px; border:#003366 solid 1px; background:#CCCCCC; position:absolute; left: 23px; top: 250px;">
                                                              <table width="629" border="0" cellspacing="0" cellpadding="0">
                                                                <tr>
                                                                  <td width="69">&nbsp;</td>
                                                                  <td width="55">&nbsp;</td>
                                                                  <td width="120">&nbsp;</td>
                                                                  <td width="190">&nbsp;</td>
                                                                  <td width="195" align="right"><a href="#" onClick="ocultar_desc('oespecificos')"><img src="iconos/cerrar.png" width="21" height="20" border="0" /></a></td>
                                                                </tr>
                                                                <tr>
                                                                  <td><label></label></td>
                                                                  <td colspan="3" align="center" class="titupatrimo"> Detalle del bien materia del acto juridico</td>
                                                                  <td><label>
                                                                    <input type="text" name="oespecific2" style="background:#FFFFFF" id="oespecific2" value="<?php echo $rowmbien['oespecific']; ?>"  />
                                                                  </label></td>
                                                                </tr>
                                                                <tr>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                  <td>&nbsp;</td>
                                                                </tr>
                                                              </table>
                                                          </div>
                                                          <?php if($rowmbien['idtipbien']=="8") 
														{ if($rowmbien['tpsm']=='P'){ echo 'Placa N. '; }
														  else if($rowmbien['tpsm']=='S'){ echo 'Serie N. '; }
														  else if($rowmbien['tpsm']=='M'){ echo 'N. Motor '; }
														}
														?></td>
                                                        <td height="15"><input name="npsm3"  type="text" id="npsm3"  value="<?php echo $rowmbien['npsm'];  ?>" size="10" <?php if($rowmbien['npsm']=='') {echo "style='display:none;background:#CCCCCC;'";}else{echo "style='background:#CCCCCC;'";}  ?>/></td>
                                                        <td height="30">&nbsp;</td>
                                                        <td height="15" align="center"><a href="#" onclick="gbienesedit()"><img src="iconos/grabar.png" alt="" width="94" height="29" border="0" /></a></td>
                                                      </tr>
                                                  </table>
<script type="text/javascript">
/*function mostrar_desc(objac)
		{
		
		if(document.getElementById(objac).style.display=="none")
		document.getElementById(objac).style.display=""
		else
		document.getElementById(objac).style.display="";
		}
*/		
</script>